// specobj.txt - This very simple script waits until this object is searched. When it
// is, calls a given special node in the current town's script.

// Memory Cells - 
//   0 - Number of a state in the town script. This is the state that is called when the item is used.
//   1,2 - Coordinates for a stuff done flag. If these are 0 and 0, ignored. Otherwise,
//     is the given flag is non-zero, nothing happens when the object is used.

beginterrainscript; 

variables;

int choice;

body;

beginstate INIT_STATE;

	break;

beginstate START_STATE;
break;

beginstate 10;
        if (get_flag(3,2) == 0) {
                reset_dialog();
                add_dialog_str(0,"This box has a mithral bar in it. Somehow, it didn't get dissolved when the wyrms took it.",0);
                add_dialog_choice(0,"Take.");
                add_dialog_choice(1,"Leave.");
                choice = run_dialog(1);
                }
        if (choice == 1) {
                set_flag(3,2,2);
                change_spec_item(2,1);
                end();
                }
        if (choice == 2)
                end();
break;

beginstate SEARCH_STATE;
        set_state_continue(10);
break;

beginstate STEP_INTO_SPOT_STATE;
        set_state_continue(10);
break;